import AccessEnum from '@/access/accessEnum'
import type { RouteRecordRaw } from 'vue-router'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'Home',
    component: () => import('@/pages/HomePage.vue'),
  },
  {
    path: '/user/login',
    name: '用户登录',
    component: () => import('@/pages/user/UserLoginPage.vue'),
  },
  {
    path: '/user/register',
    name: '用户注册',
    component: () => import('@/pages/user/UserRegisterPage.vue'),
  },
  {
    path: '/admin/userManage',
    name: '用户管理',
    component: () => import('@/pages/admin/UserManagePage.vue'),
    meta: {
      access: AccessEnum.ADMIN,
    },
  },
  {
    path: '/admin/announcementManage',
    name: '公告管理',
    component: () => import('@/pages/admin/AnnouncementManagePage.vue'),
  },
  {
    path: '/admin/bookManage',
    name: '图书管理',
    component: () => import('@/pages/admin/BookManagePage.vue'),
  },
  {
    path: '/admin/recordManage',
    name: '借阅管理',
    component: () => import('@/pages/admin/RecordManagePage.vue'),
  },
  {
    path: '/book/:id',
    name: '图书详情',
    component: () => import('@/pages/book/BookDetailPage.vue'),
  },
  {
    path: '/my/recordBook',
    name: '我的借阅',
    component: () => import('@/pages/book/MyBookRecordPage.vue'),
  },
  {
    path: '/my/recordHistory',
    name: '借阅历史',
    component: () => import('@/pages/book/MyBookRecordHistoryPage.vue'),
  },
  {
    path: '/systemAnnouncement',
    name: '系统公告',
    component: () => import('@/pages/announcement/AnnouncementPage.vue'),
  },
  {
    path: '/userInfo',
    name: '个人中心',
    component: () => import('@/layouts/UserInfoLayout.vue'),
  },
  {
    path: '/admin/data',
    name: '可视化',
    component: () => import('@/pages/admin/DataAnalyzePage.vue'),
  },
  // {
  //   path: '/:pathMatch(.*)*',
  //   name: '404',
  //   component: () => import('@/pages/NotFoundPage.vue'),
  // },
  {
    path: '/comments',
    name: '评论',
    component: () => import('@/pages/comment/CommentListPage.vue'),
  },
]

export default routes
